﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.ExpressApp.Editors;
using DevExpress.ExpressApp.Model;
using DevExpress.Utils.Drawing;
using DevExpress.XtraBars.Ribbon;
using DevExpress.XtraEditors;

namespace TransLogger.Module.Win.Editors
{
    public interface IModelTileViewItemWin : IModelViewItem
    {
    }

    [ViewItem(typeof(IModelTileViewItemWin))]
    public class TileViewItem : ViewItem
    {
        public TileViewItem(IModelViewItem model, Type type) : base(type, model.Id)
        {
        }

        protected override object CreateControlCore()
        {
            var tileControl = new GalleryControl();
            tileControl.Gallery.Orientation = Orientation.Horizontal;
            tileControl.Gallery.ImageSize = new Size(100, 100);
            tileControl.Gallery.ItemImageLayout = ImageLayoutMode.ZoomInside;
            tileControl.Gallery.ShowGroupCaption = false;
            tileControl.Gallery.ShowItemText = true ;
            tileControl.Gallery.AllowHoverImages = true;
            tileControl.Gallery.DistanceItemImageToText = 5;
            //tileControl.Gallery.FixedHoverImageSize = false;
            tileControl.Gallery.HoverImageSize = new Size(256, 256);
            tileControl.Appearance.BackColor = Color.Transparent;

            var group = new GalleryItemGroup();
            tileControl.Gallery.Groups.Add(group);

            return tileControl;
        }
    }
}
